<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <div class="datalist"><table id="flexigrid" style="display:none"></table></div>
        <script type="text/javascript">
            $(function() {
                $("#flexigrid").flexigrid($.extend(SG.flexOptions, {
                    url: '<?= site_url('logbattle/deathplayer/flexigrid') ?>',
                    colModel: 
                    [
						{display: '<?= translate('LOGFIGHT_ROLE_ID') ?>', name: 'role_id', width: '120'},
						{display: '<?= translate('LOGFIGHT_PLATFORM_ID') ?>', name: 'platform_id', width: '120', hide:'true'},
						{display: '<?= translate('LOGFIGHT_DITCH_ID') ?>', name: 'ditch_id', width: '120', hide:'true'},
						{display: '<?= translate('LOGFIGHT_VERSION') ?>', name: 'version', width: '120', hide:'true'},
						{display: '<?= translate('LOGFIGHT_SERVER_ID') ?>', name: 'server_id', width: '120'},
						{display: '<?= translate('LOGFIGHT_ACCOUNT_ID') ?>', name: 'account_id', width: '120', hide:'true'},
						
						//{display: '<?= translate('LOGFIGHT_ROLE_NAME') ?>', name: 'player.name', width: '120'},             
						{display: '<?= translate('LOGFIGHT_IP_ADDRESS') ?>', name: 'ip_address', width: '100', hide:'true'},            
						{display: '<?= translate('LOGFIGHT_ROLE_LEVEL') ?>', name: 'role_level', width: '120'},
						{display: '<?= translate('LOGFIGHT_PROFESSION_TYPE') ?>', name: 'profession_type', width: '120'}, 
						
						{display: '<?= translate('LOGFIGHT_COPY_ID') ?>', name: 'copy_id', width: '120'},
						{display: '<?= translate('LOGFIGHT_COPY_DIFFICULTY') ?>', name: 'copy_difficulty', width: '120'},
						                    
						{display: '<?= translate('LOGFIGHT_ROLE_POWER') ?>', name: 'role_power', width: '120'},  
						
						{display: '<?= translate('LOGFIGHT_SPEND_TIME') ?>', name: 'usetime', width: '120'},
						{display: '<?= translate('LOGFIGHT_KILLER_ID') ?>', name: 'killer_id', width: '300'},
						
						
						//{display: '<?= translate('LOGFIGHT_IS_TEAM_LEADER') ?>', name: 'is_team_leader', width: '120'},
						{display: '<?= translate('LOGFIGHT_OPERATION_TIME') ?>', name: 'operation_time', width: '120'},
                    ],
		    		buttons: [ {separator: true},],
                }));

                function formatUrl(value, id, cell) {
                    if (cell[0] == cell[1]) {
                        return "<a href='" + value + "' target='_blank'><?= translate('MANAGE') ?></a>";
                    } else {
                        return "<?= translate('NONE') ?>";
                    }
                }

                function formatAreaState(value, id, cell, field) {
                    var typearr = <?= json_encode($statelist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                }
                
                function formatAreaFlag(value, id, cell, field) {
                    var typearr = <?= json_encode($flaglist); ?>;
                    var arr = [];
                    
                    $.each(typearr, function(i, j) {
                        var color = i == 'hide' ? 'gray' : (i == 'new' ? 'red' : (i == 'prepare' ? 'green' : (i == 'close' ? 'gray' : '')))
                        arr.push({color: color, text: j, value: i});
                    });
                    return filterGeneral(arr, value, field);
                }
            });
        </script>
    </body>
</html>